package com.soo.hoo.admin.service;

import com.soo.hoo.admin.model.entity.SysBookReceiving;
import com.soo.hoo.admin.model.entity.SysBookReciprocation;
import com.soo.hoo.core.service.IService;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 收礼记录 服务类
 * </p>
 *
 * @author 杨燚
 * @since 2024-04-20
 */
public interface BookReceivingService extends IService<SysBookReceiving> {

    /**
     * 从导入的excel文件中提取清单数据，并存储到数据库
     *
     * @param bookId 礼簿id
     * @param file   excel文件
     */
    void saveDataFromExcel(Long bookId, MultipartFile file);

    /**
     * 导出模板
     *
     * @param request  请求对象
     * @param response 响应对象
     */
    void exportTemplate(HttpServletRequest request, HttpServletResponse response);


    /**
     * 统计收礼数
     *
     * @param bookIds 礼簿id
     * @return 收礼数
     */
    Map<Long, Integer> countReceiving(List<Long> bookIds);


    /**
     * 查询收礼信息
     *
     * @param bookIds 礼簿id
     * @return 收礼信息
     */
    Map<Long, List<SysBookReceiving>> listReceiving(List<Long> bookIds);


    /**
     * 更新是否已回礼
     *
     * @param receivingId       收礼记录id
     * @param reciprocationList 回礼记录
     */
    void updateReciprocated(Long receivingId, List<SysBookReciprocation> reciprocationList);


    /**
     * 更新是否已回礼
     *
     * @param receivingId  收礼记录id
     * @param reciprocated 是否已回礼
     */
    void updateReciprocated(Long receivingId, Boolean reciprocated);
}

